//
//  DataBaseSimple.h
//  侧滑Demo
//
//  Created by 毛志 on 14-7-2.
//  Copyright (c) 2014年 maozhi. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Message.pb.h"
#import "FuseMsg.h"
@interface DataBaseSimple : NSObject


@property(nonatomic,strong)UIAlertView *alertView;


-(id) initWithDB:(NSString *)fileName;
/**
 *  创建表
 */
- (void)createTable;
/**
 *  删除表
 */
- (void)dropTable;


/**
 *  插入
 *
 *  @param array          fuseMsgArray
 *  @param useTransaction 是否用事务型
 */
- (void)insertDBwithFuseMsgArray:(NSArray *)array useTransaction:(BOOL)useTransaction;
/**
 *  删除
 *
 *  @param key seq
 */
- (void)deleteDBwithKey:(UInt64)seq;
/**
 *  更新
 *
 *  @param key   seq
 *  @param msg messagemsg
 */
- (void)updateDBwithKey:(UInt64)seq withmsg:(FuseMsg *)fuseMsg;
/**
 *  查询获取
 *
 *  @param key  seq
 *
 *  @return 返回资料
 */
- (FuseMsg *)selectDBwithKey:(UInt64)seq;

- (NSArray *)selectAll;

-(void) close;

@end
